import InteractiveBase from "../../LevelCommon/InteractiveBase";
import LevelBaseControl from "../../LevelCommon/LevelBaseControl";

export default class ArtBoard extends InteractiveBase {
    /** 画*/
    public painting: Laya.Sprite3D;
    /** 需要的道具id*/
    public needGamePropid: number;
    private curLevelControl: LevelBaseControl;
    onStart() {
        this.painting = this.owner.getChildByName("painting") as Laya.Sprite3D;
        this.curLevelControl = window.gameFacade.LevelMng.GetCurLevelControl();
    }

    protected InteractiveLogic(): boolean {
        /** 选择了需要的道具*/
        if (this.curLevelControl.IsSelectProp(this.needGamePropid)) {
            /** 使用道具 并显示出来画*/
            this.curLevelControl.UseCurProp();
            this.painting.active = true
            this.CallToLevel();
        }
        return false;
    }
    /** 是否有画了*/
    public IsHavePainting(): boolean {
        return this.painting.active;
    }
}